//
//  PhoneRechargePayFinishViewController.m
//  HuLaQuan
//
//  Created by hok on 3/9/16.
//  Copyright © 2016 yuwubao. All rights reserved.
//

#import "PhoneRechargePayFinishViewController.h"

#import "NSString+timeFormat.h"

@interface PhoneRechargePayFinishViewController ()

@property (weak, nonatomic) IBOutlet UILabel *feeLabel;
@property (weak, nonatomic) IBOutlet UILabel *productLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *accountTypeLabel;
@property (weak, nonatomic) IBOutlet UILabel *orderNoLabel;

@end

@implementation PhoneRechargePayFinishViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
- (void)setupUI
{
    
    [self setupNavBackButton];
    
    [self updatePaymentInfo];
}
- (void)updatePaymentInfo
{
    self.feeLabel.text = [NSString stringWithFormat:@"¥%@",ServerMoneyFloatToShow(self.orderInfo[@"payAmt"])];
    self.productLabel.text = self.orderInfo[@"resName"];
    
    NSString *cardID = self.card[@"cardId"];
    self.accountTypeLabel.text = [NSString stringWithFormat:@"%@ (%@)",self.card[@"bankName"],[cardID substringFromIndex:cardID.length-4]];
    self.orderNoLabel.text = self.orderInfo[@"orderId"];
    self.timeLabel.text = [NSString dateString];
}
- (IBAction)tapFinishButton:(id)sender {
    [self goBackAction];
}
- (void)goBackAction
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
